/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.f1x.api.message.fields;

// Generated by org.f1x.tools.DictionaryGenerator from QuickFIX dictionary
public enum SecurityTradingStatus implements org.f1x.api.message.types.IntEnum {
	OPENING_DELAY(1),
	TRADING_HALT(2),
	RESUME(3),
	NO_OPEN_NO_RESUME(4),
	PRICE_INDICATION(5),
	TRADING_RANGE_INDICATION(6),
	MARKET_IMBALANCE_BUY(7),
	MARKET_IMBALANCE_SELL(8),
	MARKET_ON_CLOSE_IMBALANCE_BUY(9),
	MARKET_ON_CLOSE_IMBALANCE_SELL(10),
	NOT_ASSIGNED(11),
	NO_MARKET_IMBALANCE(12),
	NO_MARKET_ON_CLOSE_IMBALANCE(13),
	ITS_PRE_OPENING(14),
	NEW_PRICE_INDICATION(15),
	TRADE_DISSEMINATION_TIME(16),
	READY_TO_TRADE_START_OF_SESSION(17),
	NOT_AVAILABLE_FOR_TRADING_END_OF_SESSION(18),
	NOT_TRADED_ON_THIS_MARKET(19),
	UNKNOWN_OR_INVALID(20),
	PRE_OPEN(21),
	OPENING_ROTATION(22),
	FAST_MARKET(23);

	private final int code;

	SecurityTradingStatus (int code) {
		this.code  = code;
	}

	public int getCode() { return code; }

	public static SecurityTradingStatus parse(String s) {
		switch(s) {
			case "1" : return OPENING_DELAY;
			case "2" : return TRADING_HALT;
			case "3" : return RESUME;
			case "4" : return NO_OPEN_NO_RESUME;
			case "5" : return PRICE_INDICATION;
			case "6" : return TRADING_RANGE_INDICATION;
			case "7" : return MARKET_IMBALANCE_BUY;
			case "8" : return MARKET_IMBALANCE_SELL;
			case "9" : return MARKET_ON_CLOSE_IMBALANCE_BUY;
			case "10" : return MARKET_ON_CLOSE_IMBALANCE_SELL;
			case "11" : return NOT_ASSIGNED;
			case "12" : return NO_MARKET_IMBALANCE;
			case "13" : return NO_MARKET_ON_CLOSE_IMBALANCE;
			case "14" : return ITS_PRE_OPENING;
			case "15" : return NEW_PRICE_INDICATION;
			case "16" : return TRADE_DISSEMINATION_TIME;
			case "17" : return READY_TO_TRADE_START_OF_SESSION;
			case "18" : return NOT_AVAILABLE_FOR_TRADING_END_OF_SESSION;
			case "19" : return NOT_TRADED_ON_THIS_MARKET;
			case "20" : return UNKNOWN_OR_INVALID;
			case "21" : return PRE_OPEN;
			case "22" : return OPENING_ROTATION;
			case "23" : return FAST_MARKET;
		}
		return null;
	}

}